package com.x.reader.controller;

import com.x.framework.Base;
import com.x.framework.model.BaseView;
import com.x.framework.model.ResData;
import com.x.reader.model.Banner;
import com.x.reader.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@RestController
public class BannerController extends Base {

    @Autowired
    private BannerService bannerService;

    @RequestMapping(value = "/SelectBannerList")
    public ResData selectBannerList(Banner banner) {
        ResData resData = new ResData(0);
        List<Banner> bannerList = bannerService.selectBannerList(banner);
        if (bannerList.size() > 0) {
            resData.setCode(1);
            resData.setResult(bannerList);
        }
        return resData;
    }

}
